<?php
namespace Admin\Controller;
use Think\Controller;
class UserController extends Controller
{
    public function index()
    {
        $this->display();
       
    }

    /*用户信息*/
    public function userlist(){
        $user = M('user');
        $userlist = $user->order("uid asc")->field('uid,picture,username,userphone,userpassword')->select();

        for($index=0;$index<count($userlist);$index++)
        {
            $userlist[$index]['number']=$index+1;
        }

        $this->assign('userlist',$userlist);
        $this->display();
    }

      public function cardlist(){
        $card = M('card');
        $cardlist = $card->order("cardid asc")->field('cardid,username,cardcontent,cardpic,cardtime')->select();

        for($index=0;$index<count($cardlist);$index++)
        {
            $cardlist[$index]['number']=$index+1;
        }

        $this->assign('cardlist',$cardlist);
        $this->display();
    }
    public function orderlist(){
        $order = M('order');
        $orderlist = $order->order("oid asc")->field('oid,actname,otyoe,actpic,actcost,acttime,userphone,otime,onote,o_state')->select();

        for($index=0;$index<count($orderlist);$index++)
        {
            $orderlist[$index]['number']=$index+1;
        }

        $this->assign('orderlist',$orderlist);
        $this->display();
    }

     public function attentionlist(){
        $attention = M('attention');
        $attentionlist = $attention->order("atid asc")->field('atid,username,clubname,pic')->select();

        for($index=0;$index<count($attentionlist);$index++)
        {
            $attentionlist[$index]['number']=$index+1;
        }

        $this->assign('attentionlist',$attentionlist);
        $this->display();
    }
    //设置禁用
    public function state(){
        $oid=I('oid');
        $order= M('order');
        // 要修改的数据对象属性赋值
        $data['state'] = 1;
        if($order->where("oid=$oid")->save($data)) {
            $this->success('设置已审核成功');
        }else{
            $this->error('设置已审核失败');
        }
    }
    //取消禁用
   
}